home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11464 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.2 KB  |  57 lines

  1. Path: news.wwa.com!rmartin
  2. From: rmartin@oma.com (Robert C. Martin)
  3. Newsgroups: comp.lang.c++,comp.object
  4. Subject: Re: Style question: OOD & initialisation
  5. Date: 14 Mar 1996 18:08:44 GMT
  6. Organization: Object Mentor
  7. Distribution: world
  8. Message-ID: <RMARTIN.96Mar14120844@rcm.oma.com>
  9. References: <MARTING.96Mar13154718@igly.jtec.com.au>
  10. NNTP-Posting-Host: rcm.oma.com
  11. In-reply-to: marting@jtec.com.au's message of 13 Mar 1996 07:47:18 GMT
  12.  
  13. In article <MARTING.96Mar13154718@igly.jtec.com.au> marting@jtec.com.au (Martin Gregory) writes:
  14.  
  15.    main()
  16.    {
  17.      Controller TheController;
  18.    }
  19.  
  20.  
  21.    However, is this concept of a constructor that doesn't exit till the
  22.    end of time a bit of a worry?  (I think it is at least valid.)
  23.  
  24.    Would this type of thing be preferrable:
  25.  
  26.    main()
  27.    {
  28.      Controller TheController;
  29.  
  30.      TheController.Go();
  31.    }
  32.  
  33.    If so, why?
  34.  
  35.  
  36. Because it allows the following:
  37.  
  38.  
  39. main()
  40. {
  41.   Controller c1(1), c2(2);
  42.   if (/* some test */)
  43.     c1.go();
  44.   else
  45.     c2.go();
  46. };
  47.  
  48.  
  49.  
  50.  
  51. --
  52. Robert Martin       | Design Consulting   | Training courses offered:
  53. Object Mentor Assoc.| rmartin@oma.com     |   OOA/D, C++, Advanced OO
  54. 14619 N. Somerset Cr| Tel: (847) 918-1004 |   Mgt. Overview of OOT
  55. Green Oaks IL 60048 | Fax: (847) 918-1023 | http://www.oma.com
  56.  
  57.